<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set value="<%=request.getContextPath()%>" var="ctx"></c:set>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8" />
<title>实时扫码统计</title>
<link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
<link href="${ctx}/css/animate.css" rel="stylesheet">
<link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">
<script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
<script src="${ctx}/js/echarts-all.js"></script>
<script src="${ctx}/js/echartUtil.js"></script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-lg-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content" style="height: 400px">
						<div class="row">
							<div class="col-lg-12">
								<div class="flot-chart">
									<div class="flot-chart-content" id="hbchart"
										style="height: 400px"></div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<script type="text/javascript">
		var Chart = echarts.init(document.getElementById("hbchart"));
		Chart.showLoading({
			text : '正在努力的读取数据中...'
		});
		$.ajax({
			url : "${ctx}/statistics/getDSRECharts",
			type : "post",
			dataType : "json",
			success : function(data) {
				Chart.hideLoading();
				var title = "当天扫码量统计";
				var subTitle = "按小时统计";
				var legend = [ '扫码数量' ];
				var xAxis = data.xAxisData;
				var series = [ {
					name : '扫码数量',
					type : 'line',
					stack : '总量',
					data : data.seriesData
				} ];
				setEchartOption(Chart, title, subTitle, legend, xAxis, series);
				window.onresize = function() {
					Chart.resize(); //自适应
				}
			}
		});
	</script>
</body>
</html>